<!DOCTYPE html>
<html lang="zh" xmlns:th="http://www.thymeleaf.org">
	<head>
		<meta charset="UTF-8">
		<meta name="viewport" content="width=device-width,initial-scale=1.0,maximum-scale=1.0,minimum-scale=1.0,user-scalable=no">
		<title>疫情管理</title>
		<link rel="stylesheet" type="text/css" th:href="@{/css/mui.min.css}"/>
		<link rel="stylesheet" type="text/css" th:href="@{/css/dj_later.css}"/>


		<script th:src="@{/js/jquery.min.js}"></script>
		<script th:src="@{/js/mui.min.js}"></script>

	</head>
	<body>
		<div class="dj_box">
			<div class="wlc_div">
				<div class="dj_img">
					<img th:src="@{/img/dj_suc.png}"/>
					<p class="dj_p1">欢迎进入<span>[[${comName}]]</span></p>

					<p class="dj_p2">请将此信息出示给相关工作人员</p>
				</div>
			</div>

			<div class="wlc_div2">
				<p class="dj_p3">登记信息</p>
				<div class="wlc_con">
					<input type="hidden" name="" id="ncpOwnerId" th:value="${id}" />
					<p class="dj_mesp">姓名：<span>[[${name}]]</span></p>
					<p class="dj_mesp">身份证号：<span>[[${pinCode}]]</span></p>
					<p class="dj_mesp">人员类型：<span>[[${type}]]</span></p>
					<p class="dj_mesp">手机号：<span>[[${phone}]]</span></p>
					<p class="dj_mesp">楼栋信息：<span>[[${build}]]</span></p>
					<p class="dj_mesp">是否到过疫情严重地区：<span>[[${ncpAreaPass}]]</span></p>
					<p class="dj_mesp">是否接触过疑似病人：<span>[[${contactNcpPatient}]]</span></p>
					<p class="dj_mesp">身体是否有不适：<span>[[${illness}]]</span></p>
					<div class="dj_btn">
						<div class="dj_btnlr dj_btnleft">
							<img th:src="@{/img/chu.png}"/>
							<input type="button" name="" value="出小区" onclick="inHome('1')"/></div>
						<div class="dj_btnlr">
							<img th:src="@{/img/jin.png}"/>
							<input type="button" name="" value="进小区"  onclick="inHome('0')"/></div>
					</div>
				</div>

			</div>
		</div>
		<div class="notic" id="inHome">
			<div class="notic_con">
				<div class="close_mes">x</div>
				<p class="tw_p1" id="Text"></p>
				<p class="tw_p2" id="alertText"></p>
				<div class="tiwen">
					<input type="text" id="temperature" name="temperature" value="" placeholder="请输入体温" />
				</div>
				<div class="tw_btn">
					<input type="button" name="" onclick="sub()" value="确定" />
				</div>
			</div>
		</div>

		<div class="notic" id="inAlert">
			<div class="notic_con">
				<div class="close_mes">x</div>
				<p class="tw_p1">提示</p>
				<p class="tw_p2" id="alertTexts"></p>
				<div class="tw_btn">
					<input type="button" name="" value="确定" />
				</div>
			</div>
		</div>

	</body>
	<script th:src="@{/js/jquery.min.js}"></script>
	<script type="text/javascript">
		var type = '';
		var inText = "您即将进入小区！请尽快返回您的家中。增强卫生将康意识，适量运动、保障睡眠、不熬夜。保持良好的个人卫生习惯，咳嗽或者打喷嚏时用纸巾捂住口鼻，经常彻底洗手。居室多通风换气并保持整洁卫生。";
		var onText = "您即将离开小区！尽量不要乘坐公共交通建议步行、骑车或者乘坐私家车、班车上下班，如必须乘坐公共交通务必佩戴口罩，途中尽量避免接触车辆物品。";

		var inText1 = "您已经进入小区！请尽快返回您的家中。增强卫生将康意识，适量运动、保障睡眠、不熬夜。保持良好的个人卫生习惯，咳嗽或者打喷嚏时用纸巾捂住口鼻，经常彻底洗手。居室多通风换气并保持整洁卫生。";
        var onText1 = "您已经离开小区！尽量不要乘坐公共交通建议步行、骑车或者乘坐私家车、班车上下班，如必须乘坐公共交通务必佩戴口罩，途中尽量避免接触车辆物品。";

        var ins = "进门确认";
		var ons = "出门确认";
		function inHome(types){
            type=types
			$('#inHome').css("display","block");
            if(type == '1'){
                $("#Text").html(ons);
                $("#alertText").html(onText);
			}else{
                $("#Text").html(ins);
                $("#alertText").html(inText);
			}
		}


		$('.close_mes').on('click',function(){
			$('.notic').css('display','none')
		})
		$('.tw_btn').on('click',function(){
			$('.notic').css('display','none')
		})


		function sub(){
		    var temperature = $("#temperature").val();
			var ncpOwnerId = $("#ncpOwnerId").val();
		    if(temperature == "" || temperature == null){
		        mui.alert("请输入体温");
				return false;
			}
            $.ajax({
                url:"../record/updateData",
                type: "post",
                dataType: "json",
                data:{
					ncpOwnerId:ncpOwnerId,
                    temperature:temperature,
                    type:type
                },
				success: function(data) {
					if(type == '0'){
						$('#inAlert').css("display","block");
						$("#alertTexts").html(inText1);
					}else{
						$('#inAlert').css("display","block");
						$("#alertTexts").html(onText1);
					}
                }
            })
		}

	</script>
</html>
